# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-nox
pkgver=2022.1.7
pkgrel=1
pkgdesc="Flexible test automation for Python"
url="https://nox.thea.codes/"
arch="noarch"
license="Apache-2.0"
depends="
	py3-argcomplete
	py3-colorlog
	py3-packaging
	py3-py
	py3-setuptools
	py3-virtualenv
	py3-wheel
	python3
	"
makedepends="py3-build py3-installer"
checkdepends="py3-pytest py3-tox"
source="https://github.com/theacodes/nox/archive/$pkgver/py3-nox-$pkgver.tar.gz"
builddir="$srcdir/nox-$pkgver"

build() {
	python3 -m build --skip-dependency-check --no-isolation --wheel .
}

check() {
	python3 -m venv --system-site-packages test-env
	test-env/bin/python3 -m pip install --no-deps \
		"$builddir"/dist/nox-$pkgver-py3-none-any.whl
	# all tox_to_nox tests have python2.7 hardcoded
	test-env/bin/python3 -m pytest --ignore=tests/test_tox_to_nox.py
}

package() {
	python3 -m installer -d "$pkgdir" --compile-bytecode 0 \
		dist/nox-$pkgver-py3-none-any.whl
}

sha512sums="
f71ab36b76a655fff9f2bc41fbb7b469f00de3891491882c71da2c170c2f457830c37e43cc57c14db6618034f926d99c8e346efe613ad30202b3d0386ec735a9  py3-nox-2022.1.7.tar.gz
"
